<?php

namespace app\admin\controller;

use think\Controller;
use think\Request;
use think\Db;


class Common extends Controller
{

  public $userInfo = array();

  public function _initialize()
  {
    $signature = "";


    if (!empty($_SERVER['HTTP_X_TOKEN'])) {
      $signature = $_SERVER['HTTP_X_TOKEN'];
      $userInfo = verifyToken($signature);
      $this->userInfo = $userInfo;
    } else {
        // 数组转成Json
     echo   json_encode(array(
            "code" => 400,
            "data" => array(),
            "message" => "登入异常",
        ) ,JSON_UNESCAPED_UNICODE);
        die();

    }
  }
}
